LearningSession.Render Method

Reads a file from within the package associated with this session and writes it to an HttpResponse.

Parent Type: LearningSession

Namespace: Microsoft.LearningComponents

Assembly: Microsoft.LearningComponents.dll

Syntax
C#

public abstract void Render (
RenderContext context

)

Parameters

context

The context within which to render the file.

Exceptions
Exception type Condition
ArgumentNullException

Thrown if context is not provided.

InvalidOperationException

Thrown if context.RelativePath or one of Responseis not provided, or there is no current activity identitified in the session. Also thrown if an Execute session requests to render content when the attempt is not active.

FileNotFoundException

Thrown if the file referenced in context.RelativePath cannot be found, or if the caller requests to render the package manifest.

DirectoryNotFoundException

Thrown if the file refernced in context.RelativePath includes a directory that does not exist in the package.

Remarks

At a minimum, the caller must set the following properties in the context:

On return, the following values in context may have been set by the session: In addition, the content was rendered into the Response of context.

This method will not read and write content that is not contained within the package. For instance, if the entry point for an activity is an absolute URL and the caller passes it as the context.RelativePath, this method will not succeed. It also will not render the package manifest.